div(ng-controller='LeftBarController as leftBar')
  include ./editor-prompt.pug
  include ./history-prompt.pug
  .left-column.overflow-x-hidden
    .row
      a.row(ng-class="{'active': leftBar.global, 'action-link-disabled': shell.globalDisabled}", ng-click='shell.globalDisabled ? shell.enableGlobal() : leftBar.selectGlobal()')
        img.global-img(src="img/npm-logo-cube.svg")
        | Globals
      div(ng-repeat="item in shell.projects | orderBy: 'dirName' track by $index")
        a.row.project(title="{{ item.shrinkwrap ? 'Has shrinkwrap' : '' }}", ng-right-click="leftBar.rightClickMenu(item, $event)", ng-class="{'active': leftBar.selectedProject === item && !leftBar.global, 'shrinkwrapped': item.shrinkwrap}", ng-if="leftBar.removedProject !== item", ng-click='leftBar.selectProject(item, $event)')
          i.fa.fa-folder-o
          i.fa.fa-lock(ng-if="item.shrinkwrap")
          | {{item.dirName}}
          span.button-delete-project(ng-click="leftBar.deleteProject(item, $event)")
            i.fa.fa-times-circle-o
        div(ng-init="leftBar.cancelProgressActionId = false;")
          .left-progress.left-progress-minor.color-white.fake-link(ng-repeat="runningScript in leftBar.npmRunningScriptsProject[item.path] track by $index")
            small.running-name
              | &#8627; running: {{runningScript}}
            small.running-end(ng-click="leftBar.deleteRunningScript(item.path, runningScript)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white.fake-link(ng-show="leftBar.npmInstallingProjects[item.dirName]")
            small.running-name
              | &#8627; installing
            small.running-end(ng-click="leftBar.deleteInstallingProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white(ng-show="leftBar.npmReinstallingProjects[item.dirName]")
            small.running-name
              | &#8627; reinstalling
            small.running-end(ng-click="leftBar.deleteReinstallingProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white(ng-show="leftBar.npmBuildingProjects[item.dirName]")
            small.running-name
              | &#8627; building
            small.running-end(ng-click="leftBar.deleteBuildingProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white(ng-show="leftBar.npmPruningProjects[item.dirName]")
            small.running-name
              | &#8627; pruning
            small.running-end(ng-click="leftBar.deletePruningProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white(ng-show="leftBar.npmDedupingProjects[item.dirName]")
            small.running-name
              | &#8627; deduping
            small.running-end(ng-click="leftBar.deleteDedupingProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
          .left-progress.color-white(ng-show="leftBar.npmShrinkwrappingProjects[item.dirName]")
            small.running-name
              | &#8627; shrinkwrapping
            small.running-end(ng-click="leftBar.deleteShrinkwrappingProjects(item.dirName)")
              i.fa.fa-times-circle-o
              | dismiss
            .left-progress-loading
    br
